<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>

<link href="../css/sys.css" type="text/css" rel="stylesheet" />
    <script src="../js/jquery-3.2.1.js"></script>
    <script>
        urlinfo = window.location.href; //获取当前页面的url
        len = urlinfo.length;//获取url的长度
        offset = urlinfo.indexOf("?");//设置参数字符串开始的位置
        newsidinfo = urlinfo.substr(offset, len)//取出参数字符串 这里会获得类似“id=1”这样的字符串
        newsids = newsidinfo.split("=");//对获得的参数字符串按照“=”进行分割
        newsid = newsids[1];//得到参数值
        newsname = newsids[0];//得到参数名字

        $.ajax({
            url:"selectrefer",
            type:"post",
            data:{
                rid:newsid
            },
            success:function (result) {
                var refer = result.data;
                $("#name").html(refer.name);
                $("#tel").html(refer.telephone);
                $("#qq").html(refer.qq);
                $("#staffname").html(refer.staff.staffname);
                $("#level").html(refer.intentionlevel);
                $("#coursetype").html(refer.aClass.courseType.coursename);
                $("#source").html(refer.source);
                $("#remark").html(refer.remark);
                $("#cname").html(refer.aClass.name);
            }
        })

        $.ajax({
            url:"selectallfollow?referid="+newsid,
            post:"post",
            success:function (result) {
                var followList = result.data;
                for (var i in followList){
                    var follow = followList[i];
                    addNewTR(follow);
                }
            }
        })
        function addNewTR(follow) {
            $("#body").append("<tr><td style='padding-left: 10px;'>"+follow.content+"</td >" +
                    "<td align='center'>"+follow.followtime+"</td><td align='center'>"+follow.staff.staffname+"</td></tr>");
        }

        function addFollow() {
            window.location.href='addfollowpage?referid='+newsid;
        }
    </script>
</head>

<body class="emp_body">
 <table border="0" cellspacing="0" cellpadding="0" width="100%">
  <tr>
    <td class="topg"></td>
  </tr>
</table>

<table border="0" cellspacing="0" cellpadding="0"  class="wukuang"width="100%">
  <tr>
    <td width="1%"><img src="../images/tleft.gif"/></td>
    <td width="44%" align="left">[查看咨询学生]</td>
   
    <td width="52%"align="right">
       <%--退回 --%>
       <a href="referlist?status=1">
       		<img src="../images/button/tuihui.gif" />
       </a>
    </td>
    <td width="3%" align="right"><img src="../images/tright.gif"/></td>
  </tr>
</table>


<table width="89%" class="emp_table"    style="" align="left" cellspacing="0">
  <tr>
    <td width="120px" height="35" align="left"  >姓名：</td>
    <td width="300px" align="left" ><span id="name" ></span> </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>电话：</td>
    <td><span id="tel"></span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>QQ：</td>
    <td><span id="qq"></span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>咨询人：</td>
    <td><span id="staffname"></span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>意向级别：</td>
    <td><span id="level"></span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>意向学科：</td>
    <td><span id="coursetype"></span> &nbsp;&nbsp;&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>意向班级：</td>
    <td><span id="cname"></span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="41" align="left">来源：</td>
    <td align="left"><span id="source"></span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="left">备注：</td>
    <td align="left"><span id="remark"></span></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
    <td>跟踪信息：</td>
    <td>
    	<a onclick="addFollow()">添加跟踪</a>
    </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
  	
    <td colspan="3">
    	<table class="emp_table" style="width:70%; border:1px solid #CCC; margin-left:0" align="left">
            <thead>
	      <tr>
	        <td align="center">内容</td>
	        <td width="150px" align="center">时间</td>
	        <td width="80px" align="center">资源人员</td>
	      </tr>
            </thead>
            <tbody id="body">

            </tbody>


	    </table>
	</td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>
</table>

</body>
</html>